#ifndef __ZAPI_AUDIO_H__
#define __ZAPI_AUDIO_H__

typedef void (*AudioCallbackFunc)(Uint8 event );
typedef Uint8 BspTwl3029_AudioAccessoryType;
typedef void (*PMMI_FIFO_REC_STOP)(void);
typedef void (*PMMI_PLAYER_STOP)(void);
typedef unsigned char * (*PMMI_FIFO_PLAY)(Uint32 file_offset);
typedef void (*PMMI_FIFO_REC)(unsigned char* p_buf, Uint32 size, unsigned char flag);

typedef struct ZAPI_Audio {
    int (*Init)(void (*AudioCallback)(unsigned char session_num,
                                    unsigned char event),
                unsigned short sessionType,
                unsigned long buffer_size,
                short** ppShareBuffer,
                signed char *session_num);
    int (*StartSession)(unsigned char sessionNum,
                unsigned long wakeupPeriod,
                unsigned short uplinkLevel,
                unsigned short downlinkLevel,
                unsigned short uplinkSpeed,
                unsigned short downlinkSpeed);
    int (*RegisterCallback)(AudioCallbackFunc callback_function,
                Uint8 AccessoryType);
    int (*Config)(long pathindex, int vol_level);
    int (*Write)(short *wav_buffer, unsigned long size);
    unsigned long (*GetASFStatus)(unsigned char sessionNum);
    int (*SetAppStatus)(unsigned char sessionNum,
                unsigned long writeOffset);
    int (*Close)(unsigned char sessionNum);
    int (*End)(unsigned char sessionNum);
    int (*UpdateAppStatus)(unsigned char sessionNum,
                unsigned short uplinkLevel,
                unsigned short downlinkLevel,
                unsigned short uplinkSpeed,
                unsigned short downlinkSpeed);
    int (*Recorder_PowerOn)(
                int AudioType,
                int Media,
                int InputType);
	void (*FIFO_REC_Register)(PMMI_FIFO_REC pMMI_cb);
	void (*RECORDER_STOP_Register)(PMMI_FIFO_REC_STOP pMMI_cb);
    int  (*Recorder_Record)(void * pData);
    void (*Recorder_Stop)(int InputType);
    void (*Recorder_Pause)(void);
    void (*Recorder_Resume)(void);
    void (*Recorder_SetLength)(unsigned long nLength);
    void (*Recorder_GetLength)(unsigned long *pnLength);
    void (*Recorder_PowerOff)(void);
    int  (*Player_PowerOn)(int Aud_Type, int Med_Type);
    void (*PLAYER_STOP_Register)(PMMI_PLAYER_STOP pMMI_cb);
    void (*FIFO_PLAY_Register)(PMMI_FIFO_PLAY pMMI_cb);
    int  (*Player_SetPath)(int playindex, int vol_level);
    int  (*Player_Play)(int playindex, int vol_level, void *music_data, int data_size);
    int  (*Player_Stop)(void);
    void (*Player_Loop)(unsigned char enable);
    int  (*Player_GetTotalTime)(unsigned long *sec);
    unsigned long (*Player_GetPlayTime)(void);
    void (*Player_Forward)(unsigned long sec);
    void (*Player_Rewind)(unsigned long sec);
    void (*Player_SetEQ)(int style);
    void (*Player_Pause)(void);
    void (*Player_Resume)(void);
    int  (*Player_PowerOff)(void);
    int  (*Player_Folder_Change)(unsigned char *path);
    int  (*Init48k)(int sample_rate, int bits_per_sample, int channels);
    int  (*End48k)();
    int  (*Write48k)(short *wav_buffer,
                    unsigned long buffer_size,
                    unsigned long *pCopy_Size);
    void (*SetA2dpEnabled)(unsigned char isenabled);
    int  (*Recorder_Init)();
    int  (*Recorder_Read)(char *pRecordBuffer,
                          unsigned long BufferSize,
                          unsigned long *pReadSize);
    int  (*Recorder_End)();
} ZAPI_Audio;

#endif //__ZAPI_AUDIO_H__

